export const NOT_SUBMIT = '0'
export const REJECT = '1'
export const UNDETERMINED = '2'
export const SUPPLEMENT = '3'
export const REVIEW = '5'
export const APPROVED = '8'
export const FINISH = '9'
export const CANCEL = '10'

export const statusArray = [
  {
    dictValue: NOT_SUBMIT,
    dictLabel: '待提交'
  },
  {
    dictValue: UNDETERMINED,
    dictLabel: '待定'
  },
  {
    dictValue: REJECT,
    dictLabel: '已驳回'
  },
  {
    dictValue: SUPPLEMENT,
    dictLabel: '完善资料'
  },
  {
    dictValue: REVIEW,
    dictLabel: '审核中'
  },
  {
    dictValue: APPROVED,
    dictLabel: '已审核'
  },
  {
    dictValue: FINISH,
    dictLabel: '已完结'
  },
  {
    dictValue: CANCEL,
    dictLabel: '已作废'
  }
]

/**
 * 一般用于判断按钮是否可以操作（修改、提交）
 * @param row 业务实体数据
 * @returns {boolean} 是否
 */
export function canHandle(row) {
  return row.status === NOT_SUBMIT || row.status === REJECT
}

/**
 * 用于判断按钮是否可以删除
 * @param row 业务实体数据
 * @returns {boolean} 是否
 */
export function canDelete(row) {
  return row.status === NOT_SUBMIT
}

/**
 * 用于判断按钮是否可以作废
 * @param row 业务实体数据
 * @returns {boolean} 是否
 */
export function canCancel(row) {
  return row.status === REJECT
}
